export const getuserinfo = (str: string) => {
    const sql = `SELECT u.*,ul.*,
    CONVERT(COALESCE(tb.asum,0),UNSIGNED) AS asum,
    CONVERT(COALESCE(re.smmb,0),UNSIGNED) AS smmb,
    CONVERT(COALESCE(tb.asum,0)-COALESCE(re.smmb,0),UNSIGNED) AS mmb
    FROM user_info AS u 
    LEFT JOIN (SELECT t.user_id,SUM(t.num*b.num) AS asum FROM todo AS t,bonus as b WHERE t.bonus_id=b.id GROUP BY t.user_id) AS tb 
    ON u.id=tb.user_id
    LEFT JOIN (SELECT e.user_id,SUM(r.num) AS smmb FROM reward AS r,exchange AS e WHERE r.id=e.reward_id GROUP BY e.user_id) AS re 
    ON u.id=re.user_id 
    LEFT JOIN user_link AS ul
    ON ul.link_users LIKE CONCAT('%', u.id,'%')
    WHERE u.${str};`
    return sql
}